﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CognisessWeb.Models.BlogsModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="why">
        <div class="why_l">
            <ul class="why_l_a">
                <li>
                    <%= Html.ActionLink("Latest News", "LatestNews", "Account")%></li>
                <li>Cogniblog</li>
                <li>
                    <%= Html.ActionLink("Press Releases", "PressReleases", "Account")%></li>
                <li>
                    <%= Html.ActionLink("Media Contacts", "Media", "Account")%></li>
                <%--<li>
                    <%= Html.ActionLink("images and Graphics Library", "Library", "Account")%></li>
                <li>
                    <%= Html.ActionLink("Twitter", "Twitter", "Account")%></li>
                <li>
                    <%= Html.ActionLink("Facebook", "Facebook", "Account")%></li>
                <li></li>--%>
            </ul>
        </div>
        <div class="contact_r">
            <h1 class="why_r_h1">
                Media Contacts</h1>
            <div class="contact">
                <b class="contact_t"></b><b class="contact_c">
                    <div class="contact_cl">
                        <div class="contact_cl_a">
                            <a href="http://www.twitter.com/">
                                <img src="../../Content/images/home_foot_img1.gif" alt="" /></a> <a href="http://www.facebook.com/">
                                    <img src="../../Content/images/home_foot_img2.gif" alt="" /></a> <a href="http://www.youtube.com/">
                                        <img src="../../Content/images/home_foot_img3.gif" alt="" /></a> <a href="#">
                                            <img src="../../Content/images/home_foot_img4.gif" alt="" /></a></div>
                        <div class="contact_cl_b">
                            <h1 class="contact_h1">
                                <img src="../../Content/images/contact_img1.gif" alt="" />
                                Entries(RSS)
                                <img src="../../Content/images/contact_img1.gif" alt="" />
                                Comments(RSS)</h1>
                            <div class="contact_cl_b1">
                                <h2 class="contact_h2">
                                    Cognisess<br />
                                    What's happening on twitter</h2>
                                <ul class="contact_cl_b2">
                                    <li><a href="#">Back there for a design conference last month...</a></li>
                                    <li><a href="#">Back there for a design conference last month...</a></li>
                                    <li><a href="#">Back there for a design conference last month...</a></li>
                                    <li><a href="#">Back there for a design conference last month...</a></li>
                                </ul>
                                <p class="contact_cl_b3">
                                    <span>join the conversation</span>twitter</p>
                            </div>
                        </div>
                        <div class="contact_cl_c">
                            <ul>
                                <li>Cognisess on <a href="http://www.facebook.com/">Facebook</a></li>
                                <li>Cognisess on <a href="http://www.youtube.com/">You Tube</a></li>
                            </ul>
                        </div>
                        <div class="contact_cl_d">
                            <ul>
                                <li>
                                    <img src="../../Content/images/more_9.gif"><span>This process occurs in a various ways.
                                        For instance, sometimes we need to focus or to concentrate</span></li>
                                <li>
                                    <img src="../../Content/images/more_9.gif"><span>This process occurs in a various ways.
                                        For instance, sometimes we need to focus or to concentrate – as when we are reading
                                        a book.</span></li>
                                <li>
                                    <img src="../../Content/images/more_9.gif"><span>This process occurs in a various ways.
                                        For instance, sometimes we need to focus or </span></li>
                            </ul>
                        </div>
                    </div>
                    <div class="contact_cr" id="blogdiv">
                        <h1 class="contact_cr_h1">
                            The Blog</h1>
                        <%int count = 0;
                          foreach (var item in Model)
                          {                               
                        %>
                        <div class="contact_cr_a">
                            <h2 class="contact_cr_h2">
                                <label>
                                    <%=item.CreateTime.Day %><br />
                                    <em>
                                        <%=item.CreateTime.Year %>/<%=item.CreateTime.Month %></em></label>
                                <%=Html.Encode(item.Title) %>
                                <p>
                                    Author Guest In:<%=Html.Encode(item.BloggerName) %></p>
                            </h2>
                            <%%>
                            <div class="contact_cr_a1">
                                <img src="../../Content/images/member_4.gif" alt="" hspace="2" /><%=Html.Encode(item.BlogContent) %></div>
                        </div>
                        <%}
                          
                          CognisessService.AccountBLL bll = new CognisessService.AccountBLL();
                          count = bll.GetBlog(new CognisessDA.Blog { }).Count;
                        %>
                        <div class="contact_page">
                            Pages (<%=count %>) :
                            <%
        
                                int p = Math.Max((+count - 1) / 2, 1);
                                int o = 0;

                                if (Request.QueryString["page"] != null && Request.QueryString["page"].ToString().Trim().Length > 0)
                                {
                                    o = int.Parse(Request.QueryString["page"].Trim().ToString());
                                }
                                if (o == 0 &&  count == 2)
                                {%>
                            <%=Html.Label("First")%>
                            <% 
                                }
                                else
                                {
                                    if (o == 0)
                                    {%>
                            <%=Html.Label("First")%>
                            <%=Html.ActionLink("Next", "Cogniblog?page=" + (o + 1) + "")%>
                            <%=Html.ActionLink("Last", "Cogniblog?page=" + p + "")%>
                            <% 
                                         
                                    }
                            else if (o == p)
                                {%>
                            <%=Html.ActionLink("First", "Cogniblog?page=0")%>
                            <%=Html.ActionLink("Reverse", "Cogniblog?page=" + (p - 1) + "")%>
                            <%=Html.Label("Last")%>
                            <%}
                                else
                                {%>
                            <%=Html.ActionLink("First", "Cogniblog?page=0")%>
                            <%=Html.ActionLink("Reverse", "Cogniblog?page=" + (o - 1) + "")%>
                            <%=Html.ActionLink("Next", "Cogniblog?page=" + (o + 1) + "")%>
                            <%=Html.ActionLink("Last", "Cogniblog?page=" + p + "")%>
                            <%}
                                 }
                                
                                 %>
                        </div>
                    </div>
                </b><b class="contact_f"></b>
            </div>
        </div>
    </div>
</asp:Content>
